<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.12"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MuldeR&#39;s Utilities for Qt: MUtils::JobObject Class Reference</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">MuldeR&#39;s Utilities for Qt
   </div>
   <div id="projectbrief">MUtilities</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.12 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
</script>
<script type="text/javascript" src="../../menudata.js"></script>
<script type="text/javascript" src="../../menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('../../',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="../../d3/da6/namespace_m_utils.html">MUtils</a></li><li class="navelem"><a class="el" href="../../dc/dd3/class_m_utils_1_1_job_object.html">JobObject</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="../../d1/d08/class_m_utils_1_1_job_object-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">MUtils::JobObject Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>This class represents a job object.  
 <a href="../../dc/dd3/class_m_utils_1_1_job_object.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="../../d4/d85/_job_object_8h_source.html">JobObject.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a4ec8b0013bca35149def434b738d80fb"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/dd3/class_m_utils_1_1_job_object.html#a4ec8b0013bca35149def434b738d80fb">JobObject</a> (void)</td></tr>
<tr class="memdesc:a4ec8b0013bca35149def434b738d80fb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a new <a class="el" href="../../dc/dd3/class_m_utils_1_1_job_object.html" title="This class represents a job object. ">JobObject</a> instance.  <a href="#a4ec8b0013bca35149def434b738d80fb">More...</a><br /></td></tr>
<tr class="separator:a4ec8b0013bca35149def434b738d80fb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0e2d6461729d16b615548e7b1594c893"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/dd3/class_m_utils_1_1_job_object.html#a0e2d6461729d16b615548e7b1594c893">~JobObject</a> (void)</td></tr>
<tr class="memdesc:a0e2d6461729d16b615548e7b1594c893"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destroys the <a class="el" href="../../dc/dd3/class_m_utils_1_1_job_object.html" title="This class represents a job object. ">JobObject</a> instance.  <a href="#a0e2d6461729d16b615548e7b1594c893">More...</a><br /></td></tr>
<tr class="separator:a0e2d6461729d16b615548e7b1594c893"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1d86b1a284da53bbcf92713d494c2304"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/dd3/class_m_utils_1_1_job_object.html#a1d86b1a284da53bbcf92713d494c2304">isObjectCreated</a> (void)</td></tr>
<tr class="memdesc:a1d86b1a284da53bbcf92713d494c2304"><td class="mdescLeft">&#160;</td><td class="mdescRight">Test whether job object was created successfully.  <a href="#a1d86b1a284da53bbcf92713d494c2304">More...</a><br /></td></tr>
<tr class="separator:a1d86b1a284da53bbcf92713d494c2304"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1ea821a376842494b0d0ef0b17bfaecc"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/dd3/class_m_utils_1_1_job_object.html#a1ea821a376842494b0d0ef0b17bfaecc">addProcessToJob</a> (const QProcess *const process)</td></tr>
<tr class="memdesc:a1ea821a376842494b0d0ef0b17bfaecc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add a process to the job object.  <a href="#a1ea821a376842494b0d0ef0b17bfaecc">More...</a><br /></td></tr>
<tr class="separator:a1ea821a376842494b0d0ef0b17bfaecc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abe785eacf0468533ca90c6f77d734cda"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/dd3/class_m_utils_1_1_job_object.html#abe785eacf0468533ca90c6f77d734cda">terminateJob</a> (const quint32 &amp;exitCode)</td></tr>
<tr class="memdesc:abe785eacf0468533ca90c6f77d734cda"><td class="mdescLeft">&#160;</td><td class="mdescRight">Terminate all sub-processes of the job object.  <a href="#abe785eacf0468533ca90c6f77d734cda">More...</a><br /></td></tr>
<tr class="separator:abe785eacf0468533ca90c6f77d734cda"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>This class represents a job object. </p>
<p>Call <a class="el" href="../../dc/dd3/class_m_utils_1_1_job_object.html#a1ea821a376842494b0d0ef0b17bfaecc" title="Add a process to the job object. ">addProcessToJob()</a> to add another sub-process to this job object. Call <a class="el" href="../../dc/dd3/class_m_utils_1_1_job_object.html#abe785eacf0468533ca90c6f77d734cda" title="Terminate all sub-processes of the job object. ">terminateJob()</a> to terminate all sub-processes that belong to this job object. Note that all sub-processes that belong to this job object will also be terminated when <em>this</em> process exits, gracefully or due to a crash.</p>
<p>Also, when the <a class="el" href="../../dc/dd3/class_m_utils_1_1_job_object.html" title="This class represents a job object. ">JobObject</a> instance is destroyed, all sub-process that belong to its corresponding job object and that are still running will be terminated! </p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a4ec8b0013bca35149def434b738d80fb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4ec8b0013bca35149def434b738d80fb">&sect;&nbsp;</a></span>JobObject()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">MUtils::JobObject::JobObject </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Create a new <a class="el" href="../../dc/dd3/class_m_utils_1_1_job_object.html" title="This class represents a job object. ">JobObject</a> instance. </p>
<p>Creating a new <a class="el" href="../../dc/dd3/class_m_utils_1_1_job_object.html" title="This class represents a job object. ">JobObject</a> instance automatically creates a new job object on the system-level. Check <a class="el" href="../../dc/dd3/class_m_utils_1_1_job_object.html#a1d86b1a284da53bbcf92713d494c2304" title="Test whether job object was created successfully. ">isObjectCreated()</a> to test whether the job object was successfully created or not. </p>

</div>
</div>
<a id="a0e2d6461729d16b615548e7b1594c893"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0e2d6461729d16b615548e7b1594c893">&sect;&nbsp;</a></span>~JobObject()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">MUtils::JobObject::~JobObject </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Destroys the <a class="el" href="../../dc/dd3/class_m_utils_1_1_job_object.html" title="This class represents a job object. ">JobObject</a> instance. </p>
<p>If the job object still has any running sub-processes left when the corresponding <a class="el" href="../../dc/dd3/class_m_utils_1_1_job_object.html" title="This class represents a job object. ">JobObject</a> instance is destroyed, these sub-process are terminated! </p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a1ea821a376842494b0d0ef0b17bfaecc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1ea821a376842494b0d0ef0b17bfaecc">&sect;&nbsp;</a></span>addProcessToJob()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool MUtils::JobObject::addProcessToJob </td>
          <td>(</td>
          <td class="paramtype">const QProcess *const&#160;</td>
          <td class="paramname"><em>process</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Add a process to the job object. </p>
<p>This function adds a another sub-process to the job object that is represented by this <a class="el" href="../../dc/dd3/class_m_utils_1_1_job_object.html" title="This class represents a job object. ">JobObject</a> instance. Job object limitations apply to the sub-process a</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">process</td><td>A read-only pointer to the <a href="http://doc.qt.io/qt-4.8/qprocess.html">QProcess</a> object that represents the sub-process to be added to the job object. The sub-process must be in the "running" state; otherwise the function will fail.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The function returns <code>true</code>, if and only if the process was successfully added to the job object; otherwise it returns <code>false</code>. </dd></dl>

</div>
</div>
<a id="a1d86b1a284da53bbcf92713d494c2304"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1d86b1a284da53bbcf92713d494c2304">&sect;&nbsp;</a></span>isObjectCreated()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool MUtils::JobObject::isObjectCreated </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Test whether job object was created successfully. </p>
<p>The job object will be created automatically when a new <a class="el" href="../../dc/dd3/class_m_utils_1_1_job_object.html" title="This class represents a job object. ">JobObject</a> instance is created. However, the constructor has <b>no</b> to tell whether the job object was created successfully on the system-level. Call this function to test whether the job object has been created.</p>
<dl class="section return"><dt>Returns</dt><dd>The function returns <code>true</code>, if and only if a job object was successfully created; otherwise it returns <code>false</code>. </dd></dl>

</div>
</div>
<a id="abe785eacf0468533ca90c6f77d734cda"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abe785eacf0468533ca90c6f77d734cda">&sect;&nbsp;</a></span>terminateJob()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool MUtils::JobObject::terminateJob </td>
          <td>(</td>
          <td class="paramtype">const quint32 &amp;&#160;</td>
          <td class="paramname"><em>exitCode</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Terminate all sub-processes of the job object. </p>
<p>This function immediately terminates <em>all</em> running sub-processes that belong to the job object represented by this <a class="el" href="../../dc/dd3/class_m_utils_1_1_job_object.html" title="This class represents a job object. ">JobObject</a> instance at once.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">exitCode</td><td>The exit code to be set for the sub-process when they are terminated.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The function returns <code>true</code>, if the sub-processes were destroyed successfully, even if there were no running sub-process left; otherwise it returns <code>false</code>. </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>include/MUtils/<a class="el" href="../../d4/d85/_job_object_8h_source.html">JobObject.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="../../doxygen.png" alt="doxygen"/>
</a> 1.8.12
</small></address>
</body>
</html>
